self.addEventListener('message', function(e) {
    if(e.data == "timecombo1"){
        var h1 = setTimeout(function () { console.log("HelloWorker1 - in 1 second"); }, 1000);
        //clearInterval(h1);
        var h2 = setTimeout(function () { console.log("HelloWorker2 - in 2 seconds."); }, 2000);
    }
    else if(e.data == "timecombo2"){
        var h1 = setTimeout(function () { console.log("HelloWorker1 - in 2 second"); }, 2000);
        //clearInterval(h1);
        var h2 = setTimeout(function () { console.log("HelloWorker2 - in 1 seconds."); }, 1000);
    }
    else if(e.data == "timecombo3"){
        var h1 = setTimeout(function () { console.log("HelloWorker1 - in 3 seconds."); }, 3000);
        var h2 = setTimeout(function () { console.log("HelloWorker2 - in 2 seconds."); }, 2000);
        var h3 = setTimeout(function () { console.log("HelloWorker3 - in 1 second."); }, 1000);
    }
    else if(e.data == "timecombo4"){
        var h1 = setTimeout(function () { console.log("HelloWorker1 - in 1 second."); }, 1000);
        var h2 = setTimeout(function () { console.log("HelloWorker2 - in 2 seconds."); }, 2000);
        var h3 = setTimeout(function () { console.log("HelloWorker3 - in 3 seconds."); }, 3000);
    }
    
}, false);